import { axios } from '@/utils/request'

// api接口列表
const api = {
  list: '/market.exchangeCode/list',
  add: '/market.exchangeCode/add',
  delete: '/market.exchangeCode/delete',
  exchange: '/market.exchange/list',
  deleteQcode: '/market.exchange/delete',
  addQcode: '/market.exchange/add',
  exportData: '/market.ExchangeExport/exportExchangeCode',
  exchangeLog: '/market.exchange/getExchangeLog'
}

//兑换记录
export function exchangeLog(params){
	return axios({
	  url: api.exchangeLog,
	  method: 'get',
	  params,
	})
}

// 列表记录
export function list(params) {
	console.log(params)
  return axios({
    url: api.list,
    method: 'get',
    params,
  })
}

// 新增记录
export function add(data) {
  return axios({
    url: api.add,
    method: 'post',
    data,
  })
}

// 删除记录
export function deleted(data) {
  return axios({
    url: api.delete,
    method: 'post',
    data: data,
  })
}

// 兑换码库列表
export function exchange(params) {
  return axios({
    url: api.exchange,
    method: 'get',
    params,
  })
}

// 删除兑换码库
export function deleteQcode(data) {
  return axios({
    url: api.deleteQcode,
    method: 'post',
    data: data,
  })
}

// 新增兑换码库
export function addQcode(data) {
  return axios({
    url: api.addQcode,
    method: 'post',
    data,
  })
}

// 导出兑换码库
export function exportData(params) {
  return axios({
    url: api.exportData,
    method: 'get',
    params,
  })
}
